#include "stdlib.h"
#include "stdio.h"
#include "string.h"

//int * char *
//c语言里面没有字符串这种类型。。。。。
//通过字符数组来模拟字符串
//C风格字符串是以零结尾的字符串
//
void main()
{
	//字符数组初始化
	//指定长度 如果定义的长度剩余部分补充0
	char buf1[100] = {'a', 'b', 'c'};
	//不指定长度
	char buf2[] = {'a', 'b', 'c'};

	char buf3[] = {'a', 'b', 'c','\0'};

	//通过字符串初始化字符数组 并且追加\0
	char buf4[] = "abcdefg";
	printf("%s\n", buf1 ); // output may not right, because it not ends with '\0'
	printf("%s\n", buf2 );// output may not right, because it not ends with '\0'

	printf("%s\n", buf3 );
	printf("%s\n", buf4 );

	system("pause");
}
